package service;

import org.joda.time.DateTime;

/**
 * 默认处理类
 */
public class FieldMappingServiceDefaultImpl implements FieldMappingService {
    @Override
    public Object getValueByField(String columnName, Object object) {
        switch (columnName) {
            case "XXX-XXX":
                //添加自己的逻辑
            default:
                if (object instanceof java.sql.Date) {
                    java.sql.Date d1 = (java.sql.Date) object;
                    java.util.Date d2 = new java.util.Date(d1.getTime());
                    return new DateTime(d2).toString("yyyy-MM-dd HH:mm:ss");
                }

                return object;
        }
    }
}
